# Maintainer: daurnimator <daurnimator@archlinux.org>

pkgname=postgresql-ip4r
pkgver=2.4.1
pkgrel=3
pkgdesc="IPv4/v6 and IPv4/v6 range index type for PostgreSQL"
arch=('loong64' 'x86_64')
url="https://github.com/RhodiumToad/ip4r/"
license=('custom')
depends=('postgresql')
makedepends=('clang'
             'llvm')

source=("$pkgname-$pkgver.tar.gz::https://github.com/RhodiumToad/ip4r/archive/$pkgver.tar.gz"
        LICENSE)
sha256sums=('78b9f0c1ae45c22182768fe892a32d533c82281035e10914111400bf6301c726'
            '6d61e1a86a5548ce790729a46efa621796d7b79d68e1e8bc92c29034100059a5')

build() {
    cd "ip4r-$pkgver"
    make
}

package() {
    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

    cd "ip4r-$pkgver"
    make DESTDIR="$pkgdir" install
}
